<?php

use think\facade\Route;

/**
 * 商家相关路由
 */
Route::group('business', function () {
    Route::get('/edit', 'business/edit');
    Route::post('/save', 'business/save');
    Route::post('/update', 'business/update');
    Route::post('/delete', 'business/delete');
})->middleware('verify');


//商品列表
Route::group('product', function () {
    Route::get('/apply', 'product/apply');
    Route::get('/index', 'product/index');
    Route::get('/getList', 'product/getList');
    Route::get('/add', 'product/add');
    Route::get('/edit', 'product/edit');
    Route::post('/save', 'product/save');
    Route::rule('/update', 'product/update');
    Route::post('/delete', 'product/delete');
    Route::get('/selectUser', 'product/selectUser');
})->middleware('verify');

//商品规格
Route::group('spec', function () {
    Route::get('/index', 'spec/index');
    Route::get('/getList', 'spec/getList');
    Route::get('/add', 'spec/add');
    Route::get('/edit', 'spec/edit');
    Route::get('/getSpec', 'spec/getSpec');
    Route::post('/save', 'spec/save');
    Route::rule('/update', 'spec/update');
    Route::post('/delete', 'spec/delete');
})->middleware('verify');


/**
 * 订单管理
 */
Route::group('order', function () {
    Route::get('/index', 'order/index');
    Route::get('/getList', 'order/getList');
    Route::get('/add', 'order/add');
    Route::get('/edit', 'order/edit');
    Route::get('/export', 'order/export');
    Route::get('/getArea', 'order/getArea');
    Route::post('/save', 'order/save');
    Route::post('/update', 'order/update');
    Route::post('/delete', 'order/delete');
    Route::rule('/deliver', 'order/deliver');
    Route::rule('/delivered', 'order/delivered');
})->middleware('verify');


/**
 * 评价管理
 */
Route::group('productEvaluate', function () {
    Route::get('/index', 'productEvaluate/index');
    Route::get('/getList', 'productEvaluate/getList');
    Route::get('/edit', 'productEvaluate/edit');
    Route::get('/export', 'productEvaluate/export');
    Route::post('/save', 'productEvaluate/save');
    Route::post('/update', 'productEvaluate/update');
    Route::post('/delete', 'productEvaluate/delete');
})->middleware('verify');

/**
 * 退款退货
 */
Route::group('orderRefund', function () {
    Route::get('/index', 'orderRefund/index');
    Route::get('/getList', 'orderRefund/getList');
    Route::get('/edit', 'orderRefund/edit');
    Route::get('/export', 'orderRefund/export');
    Route::post('/examine', 'orderRefund/examine');
    Route::post('/receipt', 'orderRefund/receipt');
    Route::post('/update', 'orderRefund/update');
    Route::post('/delete', 'orderRefund/delete');
})->middleware('verify');

//订单发票
Route::group('orderInvoice', function () {
    Route::get('/index', 'orderInvoice/index');
    Route::get('/getList', 'orderInvoice/getList');
    Route::get('/edit', 'orderInvoice/edit');
    Route::post('/save', 'orderInvoice/save');
})->middleware('verify');